﻿using System.Collections.Generic;
using System.Linq;
using System.Transactions;
using Core.Contract.DataContract;
using Data.BO;
using www.Core.Contract.DataContract;
using www.Data.BO;

namespace www.Controllerss
{
    public class DefaultClient
    {
        #region Value
        private readonly StoryRefBO _storyRef = new StoryRefBO();
        private readonly MenuRefBO _menuRef = new MenuRefBO();
        private readonly PhotoReBO _photoReBo = new PhotoReBO();
        private readonly VideoRefBO _videoRef = new VideoRefBO();
        private readonly AdvertiseRefBO _advertiseRef=new AdvertiseRefBO();
        //private readonly LoginBO _loginBo=new LoginBO();
        #endregion

        #region Ham lay du lieu

        public IQueryable<RelaxStoryDataContract> GetDefaultDataContracts(ref IEnumerable<RelaxPhotoDataContract>lPhotoDataContracts, ref  IEnumerable<RelaxVideoDataContract>lVideoDataContracts,ref IEnumerable<RelaxMenuDataContract> lMenuDataContracts,ref IEnumerable<RelaxAdvertiseDataContract> lAdvertiseDataContracts  )
        {
            using (var scope = new TransactionScope())
            {
                lPhotoDataContracts = _photoReBo.GetPhotoDataContracts();
                lVideoDataContracts = _videoRef.GetVideoDataContracts();
                lMenuDataContracts = _menuRef.GetAllMenuDataContracts();
                lAdvertiseDataContracts = _advertiseRef.GetAdvertiseDataContracts();
                //lUser = _loginBo.GetAllClientUser();
                var lReturn = _storyRef.GetStoryDataContracts();
                scope.Complete();
                return lReturn;
            }
        }
        #endregion
    }
}